# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=util-macros
pkgver=1.19.2
pkgrel=1
pkgdesc='X.Org Autotools macros'
arch=('any')
groups=('development')
license=('custom')
url="https://xorg.freedesktop.org/"
depends=()
source=(${url}/releases/individual/util/util-macros-${pkgver}.tar.bz2)
sha256sums=('d7e43376ad220411499a79735020f9d145fdc159284867e99467e0d771f3e712')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make -k check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make install DESTDIR="${pkgdir}"

  install -m755 -d "${pkgdir}/usr/lib"
  mv "${pkgdir}/usr/share/pkgconfig" "${pkgdir}/usr/lib/"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
